# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.HomeGraph.V1.Model.SyncResponse do
  @moduledoc """
  Response type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync) call. This should follow the same format as the Google smart home `action.devices.SYNC` [response](https://developers.home.google.com/cloud-to-cloud/intents/sync). Example: ```json { "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "agentUserId": "1836.15267389", "devices": [{ "id": "123", "type": "action.devices.types.OUTLET", "traits": [ "action.devices.traits.OnOff" ], "name": { "defaultNames": ["My Outlet 1234"], "name": "Night light", "nicknames": ["wall plug"] }, "willReportState": false, "deviceInfo": { "manufacturer": "lights-out-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" }, "customData": { "fooValue": 74, "barValue": true, "bazValue": "foo" } }] } } ```

  ## Attributes

  *   `payload` (*type:* `GoogleApi.HomeGraph.V1.Model.SyncResponsePayload.t`, *default:* `nil`) - Devices associated with the third-party user.
  *   `requestId` (*type:* `String.t`, *default:* `nil`) - Request ID used for debugging. Copied from the request.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :payload => GoogleApi.HomeGraph.V1.Model.SyncResponsePayload.t() | nil,
          :requestId => String.t() | nil
        }

  field(:payload, as: GoogleApi.HomeGraph.V1.Model.SyncResponsePayload)
  field(:requestId)
end

defimpl Poison.Decoder, for: GoogleApi.HomeGraph.V1.Model.SyncResponse do
  def decode(value, options) do
    GoogleApi.HomeGraph.V1.Model.SyncResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.HomeGraph.V1.Model.SyncResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
